home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.9 KB | 140 lines | [TEXT/GEOL] |
- Item forwarded by LOOMIS to COWSAR1 REKIETA1
-
- Item 0862049 30-Sept-90 17:50PDT
-
- From: D0130 Interactive Tele, Thomas Myers,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: CTB and MacApp
-
- Help!
- No matter what I do, I can't seem to get macApp and the CommToolbox Terminal
- windows to cooperate. Problem is that as I type my text and it leaves the
- window area it should scroll. (It did in my non-macApp version. It properly
- wraps at the right side of my view.) I don't currently support any scroll bars
- 'cause I wasn't planning on supporting any cache region to scroll into.
-
- I have a normal MacApp window (TWindow) with a view for my terminal portion of
- the window (TTerminalView).
-
- It appears that terminal windows think that they always have 24 lines of data.
- So even if I have a small view rect, no scrolling occurs before 24 lines
- happen. The same think happens with the 80/132 column selections.
-
- Am I missing something? Is there some way that the TM manager would tell me to
- force a scroll? I am assuming that the cache proc only works AFTER a scroll
- has taken place. This magic number of 24 remains the same no matter what I set
- the term & view rects with TMNew. I also tried to use TMResize to set it to a
- smaller area. Both techniques do allow me to change the DISPLAYED data area
- so it is smaller, but the window still scrolls only after 24 lines
-
-
- Here is my init and draw methods...
-
-
- pascal void TCTBDocument::AllocateCTBData(void)
- {
-
- /*
- Allocate comm link connection, file transfer records - because these
- depend on our window, we call this routine from DoMakeViews after we've
- allocated our window.
- */
- CMBufferSizes cmSizes;
- short procID;
- short result;
- CMRecFlags theCMFlags = 0;
-
- Lock(true); // We pass fxxxName to CTB
-
- TRY {
- cmSizes[cmDataIn] = kDataBufSize;
- cmSizes[cmDataOut] = kDataBufSize;
- cmSizes[cmCntlIn] = 0;
- cmSizes[cmCntlOut] = 0;
- cmSizes[cmAttnIn] = 0;
- cmSizes[cmAttnOut] = 0;
-
-
- {
- RecttermRect, viewRect;
- TMFlags flags;
- VRect frameRect;
-
- procID = TMGetProcID(fTerminalName);
- if (procID IS -1) {
- ShowDebugStr("\pNo TM procID for supplied TM tool name");
- FailOSErr(paramErr);
- }
-
- gApplication->InvalidateFocus();//••
- fCommWindow->Focus(); // Focus on window
-
- fTerminalView->GetFrame( &frameRect);
- SetRect(&termRect, (short) frameRect.left, (short) frameRect.top,
- (short) frameRect.right, (short) frameRect.bottom);
- viewRect = termRect;
- flags = tmAutoScroll;
- fTerminal = TMNew(&termRect, &viewRect, flags, procID,
- fCommWindow->fWMgrWindow,
- (ProcPtr)pTMSendProc,
- (ProcPtr)nil, /* Cache Proc */
- (ProcPtr)pTMBreakProc,
- (ProcPtr)nil, /* ClikLoop */
- (ProcPtr)pTMEnvironsProc, (long)this, nil);
- FailNIL( fTerminal);
-
- if (fTerminalData != nil) {
- result = TMSetConfig( fTerminal, fTerminalData);
- DisposPtr( fTerminalData);
- fTerminalData = nil;
- if ( result IS -1) {
- ShowDebugStr( "\pTMSetConfig failed");
- FailOSErr( paramErr);
- }
- }
- }
- }
- RECOVER {
- Lock(false);
- }
- ENDTRY
-
- Lock(false);
- }
-
- pascal void TTerminalView::Draw(Rect * /* area */)
- {
-
- TCTBDocument *myDocument;
- RgnHandle savedClip;
- VRect frameRect;
- RecttermRect;
-
- myDocument = (TCTBDocument *)fDocument;
-
- GetFocus(&gTempFocusRec);
- GetWindow()->Focus();
-
- // Get the terminal views frame!
- GetFrame( &frameRect);
- SetRect(&termRect, (short) frameRect.left, (short) frameRect.top,
- (short) frameRect.right, (short) frameRect.bottom);
-
-
- // Clip to the window content
- savedClip = NewRgn();
- GetClip( savedClip);
- ClipRect (&termRect);
-
- TMUpdate(myDocument->fTerminal, myDocument->fCommWindow->fWMgrWindow->visRgn);
-
- SetClip( savedClip);
- DisposeRgn( savedClip);
-
- SetFocus( &gTempFocusRec);
- }
-
-